home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-08-17 | 1.3 KB | 76 lines | [TEXT/MSET] |
- \ Additional data structures.
-
- \ June 91 mrh Mops version.
-
-
- :class WARRAY super{ indexed-obj } 2 indexed
-
- :m ^ELEM: \ ( index -- addr )
- inline{ ix}
- ^elem2 ;m
-
- :m AT: \ ( index -- n )
- inline{ ix w@x}
- ^elem: self w@x ;m
-
- :m TO: \ ( n index -- )
- inline{ ix w!}
- ^elem: self w! ;m
-
- :m +TO: \ ( n index -- )
- inline{ ix w+!}
- ^elem: self w+! ;m
-
- :m -TO: \ ( n index -- )
- inline{ ix w-!}
- ^elem: self w-! ;m
-
-
- :m FILL: \ ( value -- ) Fills all elements with value.
- idxbase limit 2* bounds
- ?DO dup i w! 2 +LOOP drop ;m
-
-
- :m WIDTH: 2 ;m \ Faster than the default in Indexed-obj.
-
- :m GETELEM: \ ( addr -- n ) Fetches one element at addr - saves indexing
- \ step if addr is known.
- w@x ;m
-
- ;class
-
-
- :class WORDCOL super{ (col) wArray }
- ;class \ Yep, that's all, folks!!
-
-
- :class BARRAY super{ indexed-obj } 1 indexed
-
- :m AT: \ ( index -- n )
- inline{ ix c@}
- ^elem1 c@ ;m
-
- :m TO: \ ( n index -- )
- inline{ ix c!}
- ^elem1 c! ;m
-
-
- :m ^ELEM: \ ( index -- addr )
- inline{ ix}
- ^elem1 ;m
-
- :m FILL: \ ( value -- ) Fills all elements with value.
- idxbase limit 2* bounds
- ?DO dup i c! LOOP drop ;m
-
- :m WIDTH: 1 ;m \ Faster than the default in Object
-
- :m GETELEM: \ ( addr -- n ) Fetches one element at addr
- c@x ;m
-
- ;class
-
-
- :class BYTECOL super{ (col) bArray }
- ;class
-